Action hook '{$old_status}_to_{$new_status}'

in WP Core File wp-includes/post.php at line 5539

Description

Fires when a post is transitioned from one status to another. The dynamic portions of the hook name, `$new_status` and `$old_status`, refer to the old and new post statuses, respectively. Possible hook names include: - `draft_to_publish` - `publish_to_trash` - `pending_to_draft`

Occurrences

Filename Line Number
wp-includes/post.php 5539

Parameters

Type Name Description
WP_Post $post Post object.

PHP Doc

/**
	 * Fires when a post is transitioned from one status to another.
	 *
	 * The dynamic portions of the hook name, `$new_status` and `$old_status`,
	 * refer to the old and new post statuses, respectively.
	 *
	 * Possible hook names include:
	 *
	 *  - `draft_to_publish`
	 *  - `publish_to_trash`
	 *  - `pending_to_draft`
	 *
	 * @since 2.3.0
	 *
	 * @param WP_Post $post Post object.
	 */